{% extends 'base.html' %}
{% block title %}
    {{ title }}
{% endblock %}

{% block content %}

    <div class="col-lg-6 offset-3">
        <div class="box">
            <h3 class="heading">Login</h3>
            <p class="lead">Already our have account?</p>
            {% if form.errors %}
                {% for field in form %}
                    {% for error in field.errors %}
                        <div class="alert alert-danger alert-dismissable">
                            <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
                            <strong>{{ error|escape }}</strong>
                        </div>
                    {% endfor %}
                {% endfor %}
                {% for error in form.non_field_errors %}
                    <div class="alert alert-danger alert-dismissable">
                        <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
                        <strong>{{ error|escape }}</strong>
                    </div>
                {% endfor %}
            {% endif %}
            <form action="" method="post">
                {% csrf_token %}
                {% for field in form %}
                    <div class="form-group">
                        <label for="id_{{ field.name }}">{{ field.label }}</label>
                        <input type="{{ field.field.widget.input_type }}"
                               class="form-control"
                               name="{{ field.name }}"
                               id="id_{{ field.name }}"
                               placeholder="{{ field.field.widget.attrs.placeholder }}">
                    </div>
                {% endfor %}
                <div class="text-center">
                    <button type="submit" class="btn btn-outline-white-primary"><i class="fa fa-sign-in"></i> Log in
                    </button>
                </div>
            </form>
        </div>
    </div>
{% endblock %}